<?php
/**
 *
 *
 * This file is part of Webappkit, a packages system for PHP web apps
 * @link http://webappkit.net
 * @package
 * @subpackage
 * @author J.Ducastel <nospam0@ducastel.name>
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */

class DjTextarea extends DjWidget {

    public function render($name, $value=null, $attributes=array()) {
        $out = '<textarea'
        .' name="'.$name.'"'
        .$this->_renderId($name)
        .$this->_renderAttributes($attributes).'>'
        .$this->_renderValue($value)
        .'</textarea>';
        return $out;
    }

    protected function _renderValue($value) {
        if (is_string($value))
            return $value;
        else return '';
    }
}